namespace Web.Control.Member.Message
{
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Text.RegularExpressions;
    using Lx.Web.Common.UI;
    using Lx.Web.Common.ControlsUI;
    using System.Collections;
    using System.Text;

    using BLF.WWW_User;
    using Model.WWW_User;
    using BLF.WWW_User.UserComments;

    public class Blackboard : BaseControl
	{
        protected Repeater userComment;
        protected string Memberno = "";
        protected Literal lLCount;
        private int l = 15;

        protected override void OnLoad(EventArgs e)
		{
            Memberno = HttpContext.Current.User.Identity.Name;
            if (Memberno == "")
            {
                Page.Response.Redirect("/user/login.htm?ReturnUrl=" + Page.Request.Url.AbsoluteUri);
            }
            if (lLCount != null) int.TryParse(lLCount.Text, out l);
            ArrayList arrList = UserComments.GetAllComments(Memberno, 1, l);
            if (arrList != null && arrList.Count > 0 && userComment != null)
            {

                userComment.DataSource = arrList[1];
                userComment.DataBind();
            }
            Response.Write("<script> var comPage=" + (new System.Web.Script.Serialization.JavaScriptSerializer()).Serialize(arrList[0]) + ";</script>");
            base.OnLoad(e);
		}
	}
}
